import React from 'react'
import { Modal } from 'antd'
import { SketchPicker } from 'react-color'

function ColorSelect(props) {
  const { visible, close, h5PageColor, setH5PageColor } = props
  return (
    <div className="color-select-dialog">
      <Modal
        visible={visible}
        onCancel={close}
        maskClosable={false}
        title="颜色选择"
        width="270px"
        footer={null}
      >
        <SketchPicker color={h5PageColor} onChangeComplete={color => setH5PageColor(color.hex)}/>
      </Modal>
    </div>
  )
}

export default ColorSelect
